<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="title" required="false"/>
        <cc:attribute name="image" required="false"/>
        <cc:attribute name="url" required="false" />
        <cc:attribute name="dialid" required="false" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <h:panelGrid class="dial-outter-panel"
                     rowClasses="dial-outter-row1,dial-outter-row2">
            <h:form class="wh100">
                <h:commandLink class="wh100"
                    onclick="window.open('#{cc.attrs.url}','_blank');">
                    <h:panelGrid columns="1"  class="dial-inner-panel"
                                 rowClasses="dial-title,dial-image"
                                 id="inner-dial-grid">
                        <h:outputLabel value="#{cc.attrs.title}" />
                        <h:graphicImage value="#{cc.attrs.image}" class="dial-image-image" />
                    </h:panelGrid>
                    <f:ajax listener="#{speedDialController.dialDialed}" />
                    <f:param name="d-dial-id" value="#{cc.attrs.dialid}" />
                </h:commandLink>
            </h:form>
            <h:form>
                <h:commandLink value="Törlés" class="dial-edit-link" 
                               action="#{speedDialController.removeDial}">
                    <f:param name="d-dial-id" value="#{cc.attrs.dialid}" />
                </h:commandLink>
            </h:form>
        </h:panelGrid>
    </cc:implementation>
</html>